package com.exam.controller;

import com.exam.entity.ApiResult;
import com.exam.entity.JudgeQuestion;
import com.exam.serviceimpl.JudgeQuestionServiceImpl;
import com.exam.util.ApiResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping(value = {"/judgequestioncontroller"})
public class JudgeQuestionController {

    @Autowired
    private JudgeQuestionServiceImpl judgeQuestionService;

    @RequestMapping("/judgeQuestion")
    public ResponseEntity<Integer> add(@RequestBody JudgeQuestion judgeQuestion) {
        int res = judgeQuestionService.add(judgeQuestion);
        return  new ResponseEntity<Integer>(res, HttpStatus.OK);
    }

    @RequestMapping("/judgeQuestionId")
    public ResponseEntity<JudgeQuestion> findOnlyQuestionId() {
        JudgeQuestion res = judgeQuestionService.findOnlyQuestionId();
       return  new ResponseEntity<JudgeQuestion>(res,HttpStatus.OK);
    }
}
